# _*_ coding: utf-8 _*_
# @Author   : Wei Yue
# @Time     : 2023-05-01 11:56
# @Function : 存储常量、通用方法
import os

isAbsSpd = False
EMspdIndex = 14
EMtrqIndex = 13
VelocityIndex = 1
VtrqIndex = 16
volIndex = 5
dcCurIndex = 6
freIndex = 10
acCurIndex = 9

dataPath = 'C:/5-载荷谱分析/'
# 路谱列表
ls_VW1 = [10680, 10680, 780, 360, 10680, 8580, 360, 360, 360, 780, 180, 360, 360]
ls_VW2 = [3560, 3560, 520, 5200, 3560, 1040, 1560, 120, 120, 260, 520, 120, 120]
ls_VW3 = [2136, 3204, 312, 72, 6408, 8700, 72, 36, 36, 2136, 72, 36, 36]
ls_VW4 = [2670, 2670, 2670, 90, 2670, 390, 390, 2670, 2670, 390, 390, 1335, 585]
ls_LX = [10680, 9898, 780, 299, 10680, 8580, 269, 360, 360, 780, 90, 360, 360, 782, 3000, 91]
ls_XM = [1612, 6643, 6643]
ls_HHT = [2736, 3600, 1440, 864, 18000, 7200, 7200, 9000, 144, 4680, 1008]
ls_GEELY = [5000, 418, 520, 209, 21335, 281, 2948]
ls_GM = [750, 38, 675, 375, 1688, 750, 750, 750, 6750, 5063]
ls_NEDC = [27450]
ls_WLTC = [12893]
ls_CLTC = [1]
ls_TEST = [1, 2]
ls_CLTC12 = [35891]
pathDict = {'VW1': ls_VW1, 'VW2': ls_VW2, 'VW3': ls_VW3, 'VW4': ls_VW4, 'LX': ls_LX, 'XM': ls_XM, 'HHT': ls_HHT,
            'GEELY': ls_GEELY, 'GM': ls_GM, 'NEDC': ls_NEDC, 'WLTC': ls_WLTC, 'CLTC': ls_CLTC, 'TEST': ls_TEST,
            'CLTC12': ls_CLTC12}


def dirInitialize(path):
    if not os.path.exists(path + '/cruiseDetail'):
        print('cruiseDetail文件夹不存在,自动创建')
        os.mkdir(path + '/cruiseDetail')
    if not os.path.exists(path + '/durability'):
        print('durability文件夹不存在,自动创建')
        os.mkdir(path + '/durability')
    if not os.path.exists(path + '/spectrum'):
        print('spectrum文件夹不存在,自动创建')
        os.mkdir(path + '/spectrum')
    if not os.path.exists(path + '/spectrum/DC'):
        print('spectrum/DC文件夹不存在,自动创建')
        os.mkdir(path + '/spectrum/DC')
    if not os.path.exists(path + '/spectrum/EM'):
        print('spectrum/EM文件夹不存在,自动创建')
        os.mkdir(path + '/spectrum/EM')
    if not os.path.exists(path + '/spectrum/VEHICLE'):
        print('spectrum/VEHICLE文件夹不存在,自动创建')
        os.mkdir(path + '/spectrum/VEHICLE')
    if not os.path.exists(path + '/spectrum/AC'):
        print('spectrum/AC文件夹不存在,自动创建')
        os.mkdir(path + '/spectrum/AC')
    if not os.path.exists(path + '/statistic'):
        print('statistic文件夹不存在,自动创建')
        os.mkdir(path + '/statistic')
